package com.bigmodel.util;

import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.RandomUtil;
import com.bigmodel.contant.meeting.roomSlot.RoomSlot;
import com.bigmodel.entity.TimeEntity;
import com.bigmodel.qa.timedata.TimeDataConstant;

import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.temporal.TemporalAdjusters;
import java.util.*;

/**
 * @Author: shukai.chen
 * @CreateTime: 2024-01-20 10:12
 */

public class ConferenceTimeUtils {
    private static final int randomNumber = 20;

    /**
     * 会议室房号
     */
    private static List<String> LIST_ROOM_TIME_SLOT = null;
    private static List<String> LIST_ROOM_ROOM_SLOT = null;


    static {
        LIST_ROOM_TIME_SLOT = ListUtil.toList(RoomSlot.LIST_ROOM_TIME_SLOT);
        LIST_ROOM_ROOM_SLOT = ListUtil.toList(RoomSlot.LIST_ROOM_ROOM_SLOT);
    }

    // 下周五上午10点38分身份证43031319810511958X，
    // {
    //"identityCard": "43031319810511958X",
    //"startTime": "LocalDateTime.now().with(TemporalAdjusters.next(DayOfWeek.FRIDAY)).withHour(10).withMinute(38);"
    //}
    public static void main(String[] args) {
        LocalDateTime thisTuesdayAt4_05 =
                LocalDateTime.now().with(TemporalAdjusters.next(DayOfWeek.FRIDAY)).withHour(10).withMinute(38);
        System.out.println(thisTuesdayAt4_05);

    }

    // 第一个%s代表今天开始往后几天，如1代表明天；第二个%s代表时；第三个%s代表分
    private static final String TIME_TEMPLATE_ONE =
            "LocalDateTime.now().plusDays(%s).toLocalDate().atTime(%s,%s);";
    // 本周：前三个%s代表本周几；第四个%s代表时；第五个%s代表分
    private static final String TIME_TEMPLATE_TWO =
            "LocalDateTime.now().with(%s).toLocalDate().atTime(%s,%s);";
    // 下周：第一个%s代表下周几；第二个%s代表时，第三个%s代表分
    private static final String TIME_TEMPLATE_Three = "LocalDateTime.now().plusWeeks(1).with(%s).toLocalDate().atTime(%s,%s);";

    /**
     * 提取时间 今天15点、明天14点12，大后天9点
     */
    public static Map<String, TimeEntity> T001() {

        Map<String, TimeEntity> timeEntityMap = new HashMap<>();
        Object[][] dateDescriptors = new Object[][]{{"", 0}, {"明天", 1}, {"今天", 0}, {"后天", 2}, {"大后天", 3}};
        for (Object[] dateDescriptor : dateDescriptors) {
            String dateDescriptorName = (String) dateDescriptor[0];
            int startDayStep = (int) dateDescriptor[1];
            for (int i = 0; i < randomNumber; i++) {
                int hour = RandomUtil.randomInt(0, 23);
                int min = RandomUtil.randomInt(0, 59);
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);

                // 明天9点， 后天9点15。 大后天9点15分和大后天9点15属于一个类别
                {
                    String starttimeStr = null;
                    if (min == 0) {

                        starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + dateDescriptorName + hour + "点" + roomName;
                    } else {
                        starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + dateDescriptorName + hour + "点" + min + roomName;
                        int minStr = RandomUtil.randomInt(0, 2);
                        if (minStr == 1) {
                            starttimeStr += "分";
                        }
                    }
                    timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, startDayStep, hour, min)).build());
                }

                // 明天9点
                {
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + dateDescriptorName + hour + "点" + roomName;
                    timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, startDayStep, hour, 0)).build());
                }

                // 9点过5分
                {
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = null;
                    if (min >= 0) {
                        starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + dateDescriptorName + hour + "点半" + roomName;
                        timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, startDayStep, hour, 30)).build());
                    }
                }


            }
        }

        return randomMap(timeEntityMap);
    }

    /**
     * 早上1点，上午2点，下午3点，今天4点
     *
     * @return
     */
    public static Map<String, TimeEntity> T002() {

        Map<String, TimeEntity> timeEntityMap = new HashMap<>();

        // 早上几点
        for (int x = 1; x <= 11; x++) {
            String roomName = random200List(LIST_ROOM_ROOM_SLOT);
            String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + "早上" + x + "点" + roomName;
            timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x, 0)).build());
        }
        // 早上几点几分
        for (int x = 1; x <= 11; x++) {
            for (int i = 0; i < 60; i++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + "早上" + x + "点" + i + "分" + roomName;
                timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x, i)).build());
            }
        }
        // 上午几点
        for (int x = 1; x <= 11; x++) {
            String roomName = random200List(LIST_ROOM_ROOM_SLOT);
            String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + "上午" + x + "点" + roomName;
            timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x, 0)).build());
        }
        // 上午几点几分
        for (int x = 1; x <= 11; x++) {
            for (int i = 0; i < 60; i++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + "上午" + x + "点" + i + "分" + roomName;
                timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x, i)).build());
            }
        }
        // 下午几点
        for (int x = 1; x <= 11; x++) {
            String roomName = random200List(LIST_ROOM_ROOM_SLOT);
            String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + "下午" + x + "点" + roomName;
            timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x + 12, 0)).build());
        }
        // 下午几点几分
        for (int x = 1; x <= 11; x++) {
            for (int i = 0; i < 60; i++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + "下午" + x + "点" + i + "分" + roomName;
                timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x + 12, i)).build());
            }
        }
        // 今天几点
        for (int x = 1; x <= 23; x++) {
            String roomName = random200List(LIST_ROOM_ROOM_SLOT);
            String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + "今天" + x + "点" + roomName;
            timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x, 0)).build());
        }
        // 今天几点几分
        for (int x = 1; x <= 23; x++) {
            for (int i = 0; i < 60; i++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + "今天" + x + "点" + i + "分" + roomName;
                timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x, i)).build());
            }
        }

        // 几点
        for (int x = 1; x <= 23; x++) {
            String roomName = random200List(LIST_ROOM_ROOM_SLOT);
            String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + x + "点" + roomName;
            timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x, 0)).build());
        }
        // 几点几分
        for (int x = 1; x <= 23; x++) {
            for (int i = 0; i < 60; i++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + x + "点" + i + "分" + roomName;
                timeEntityMap.put(starttimeStr, TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_ONE, 0, x, i)).build());
            }
        }
        return randomMap(timeEntityMap);
    }

    /**
     * 本周
     *
     * @return
     */
    public static Map<String, TimeEntity> T003() {
        Map<String, TimeEntity> timeEntityMap = new HashMap<>();
        List<String> days = Arrays.asList(
                "周一", "周二", "周三", "周四", "周五", "周六", "周日",
                "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日",
                "本周一", "本周二", "本周三", "本周四", "本周五", "本周六", "本周日",
                "礼拜一", "礼拜二", "礼拜三", "礼拜四", "礼拜五", "礼拜六", "礼拜日",
                "周末");

        Map<String, String> dayMap = new HashMap<>();
        dayMap.put("周一", "DayOfWeek.MONDAY");
        dayMap.put("周二", "DayOfWeek.TUESDAY");
        dayMap.put("周三", "DayOfWeek.WEDNESDAY");
        dayMap.put("周四", "DayOfWeek.THURSDAY");
        dayMap.put("周五", "DayOfWeek.FRIDAY");
        dayMap.put("周六", "DayOfWeek.SATURDAY");
        dayMap.put("周日", "DayOfWeek.SUNDAY");

        dayMap.put("星期一", "DayOfWeek.MONDAY");
        dayMap.put("星期二", "DayOfWeek.TUESDAY");
        dayMap.put("星期三", "DayOfWeek.WEDNESDAY");
        dayMap.put("星期四", "DayOfWeek.THURSDAY");
        dayMap.put("星期五", "DayOfWeek.FRIDAY");
        dayMap.put("星期六", "DayOfWeek.SATURDAY");
        dayMap.put("星期日", "DayOfWeek.SUNDAY");

        dayMap.put("本周一", "DayOfWeek.MONDAY");
        dayMap.put("本周二", "DayOfWeek.TUESDAY");
        dayMap.put("本周三", "DayOfWeek.WEDNESDAY");
        dayMap.put("本周四", "DayOfWeek.THURSDAY");
        dayMap.put("本周五", "DayOfWeek.FRIDAY");
        dayMap.put("本周六", "DayOfWeek.SATURDAY");
        dayMap.put("本周日", "DayOfWeek.SUNDAY");

        dayMap.put("礼拜一", "DayOfWeek.MONDAY");
        dayMap.put("礼拜二", "DayOfWeek.TUESDAY");
        dayMap.put("礼拜三", "DayOfWeek.WEDNESDAY");
        dayMap.put("礼拜四", "DayOfWeek.THURSDAY");
        dayMap.put("礼拜五", "DayOfWeek.FRIDAY");
        dayMap.put("礼拜六", "DayOfWeek.SATURDAY");
        dayMap.put("礼拜日", "DayOfWeek.SUNDAY");

        dayMap.put("周末", "DayOfWeek.SUNDAY");

        for (int d = 0; d < days.size(); d++) {
            String day = days.get(d);
            // 星期 + 早上 + 几 + 点
            for (int x = 1; x <= 11; x++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "早上" + x + "点" + roomName;
                timeEntityMap.put(starttimeStr,
                        TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_TWO, dayMap.get(day), x, 0)).build());
            }
            // 星期 + 早上 + 几 + 点 + 几 + 分
            for (int x = 1; x <= 11; x++) {
                for (int i = 0; i < 60; i++) {
                    String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                    String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "早上" + x + "点" + i + "分" + roomName;
                    timeEntityMap.put(starttimeStr,
                            TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_TWO,  dayMap.get(day), x, i)).build());
                }
            }
            // 星期 + 上午 + 几 + 点
            for (int x = 1; x <= 11; x++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "上午" + x + "点" + roomName;
                timeEntityMap.put(starttimeStr,
                        TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_TWO, dayMap.get(day), x, 0)).build());
            }
            // 星期 + 上午 + 几 + 点 + 几 + 分
            for (int x = 1; x <= 11; x++) {
                for (int i = 0; i < 60; i++) {
                    String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                    String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "上午" + x + "点" + i + "分" + roomName;
                    timeEntityMap.put(starttimeStr,
                            TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_TWO,  dayMap.get(day), x, i)).build());
                }
            }
            // 星期 + 下午 + 几 + 点
            for (int x = 1; x <= 11; x++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "下午" + x + "点" + roomName;
                timeEntityMap.put(starttimeStr,
                        TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_TWO,  dayMap.get(day), x + 12, 0)).build());
            }
            // 星期 + 下午 + 几 + 点 + 几 + 分
            for (int x = 1; x <= 11; x++) {
                for (int i = 0; i < 60; i++) {
                    String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                    String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "下午" + x + "点" + i + "分" + roomName;
                    timeEntityMap.put(starttimeStr,
                            TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_TWO,  dayMap.get(day), x + 12, i)).build());
                }
            }
            // 星期 + 几 + 点
            for (int x = 0; x < 24; x++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + x + "点" + roomName;
                timeEntityMap.put(starttimeStr,
                        TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_TWO, dayMap.get(day), x, 0)).build());
            }
            // 星期 + 几 + 点 + 几 + 分
            for (int x = 0; x < 24; x++) {
                for (int i = 0; i < 60; i++) {
                    String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                    String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + x + "点" + i + "分" + roomName;
                    timeEntityMap.put(starttimeStr,
                            TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_TWO,  dayMap.get(day), x, i)).build());
                }
            }
        }
        return randomMap(timeEntityMap);
    }

    /**
     * 下周
     *
     * @return
     */
    public static Map<String, TimeEntity> T004() {
        Map<String, TimeEntity> timeEntityMap = new HashMap<>();
        List<String> days = Arrays.asList(
                "下周一", "下周二", "下周三", "下周四", "下周五", "下周六", "下周日",
                "下周末");

        Map<String, String> dayMap = new HashMap<>();
        dayMap.put("下周一", "DayOfWeek.MONDAY");
        dayMap.put("下周二", "DayOfWeek.TUESDAY");
        dayMap.put("下周三", "DayOfWeek.WEDNESDAY");
        dayMap.put("下周四", "DayOfWeek.THURSDAY");
        dayMap.put("下周五", "DayOfWeek.FRIDAY");
        dayMap.put("下周六", "DayOfWeek.SATURDAY");
        dayMap.put("下周日", "DayOfWeek.SUNDAY");

        dayMap.put("下周末", "DayOfWeek.SUNDAY");

        for (int d = 0; d < days.size(); d++) {
            String day = days.get(d);
            // 下周 + 早上 + 几 + 点
            for (int x = 1; x <= 11; x++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "早上" + x + "点" + roomName;
                timeEntityMap.put(starttimeStr,
                        TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_Three, dayMap.get(day), x, 0)).build());
            }
            // 下周 + 早上 + 几 + 点 + 几 + 分
            for (int x = 1; x <= 11; x++) {
                for (int i = 0; i < 60; i++) {
                    String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                    String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "早上" + x + "点" + i + "分" + roomName;
                    timeEntityMap.put(starttimeStr,
                            TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_Three, dayMap.get(day), x, i)).build());
                }
            }
            // 下周 + 上午 + 几 + 点
            for (int x = 1; x <= 11; x++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "上午" + x + "点" + roomName;
                timeEntityMap.put(starttimeStr,
                        TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_Three, dayMap.get(day), x, 0)).build());
            }
            // 星期 + 上午 + 几 + 点 + 几 + 分
            for (int x = 1; x <= 11; x++) {
                for (int i = 0; i < 60; i++) {
                    String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                    String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "上午" + x + "点" + i + "分" + roomName;
                    timeEntityMap.put(starttimeStr,
                            TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_Three, dayMap.get(day), x, i)).build());
                }
            }
            // 下周 + 下午 + 几 + 点
            for (int x = 1; x <= 11; x++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "下午" + x + "点" + roomName;
                timeEntityMap.put(starttimeStr,
                        TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_Three, dayMap.get(day), x + 12, 0)).build());
            }
            // 下周 + 下午 + 几 + 点 + 几 + 分
            for (int x = 1; x <= 11; x++) {
                for (int i = 0; i < 60; i++) {
                    String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                    String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + "下午" + x + "点" + i + "分" + roomName;
                    timeEntityMap.put(starttimeStr,
                            TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_Three, dayMap.get(day), x + 12, i)).build());
                }
            }
            // 下周 + 几 + 点
            for (int x = 0; x < 24; x++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + x + "点" + roomName;
                timeEntityMap.put(starttimeStr,
                        TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_Three, dayMap.get(day), x, 0)).build());
            }
            // 下周 + 几 + 点 + 几 + 分
            for (int x = 0; x < 24; x++) {
                for (int i = 0; i < 60; i++) {
                    String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                    String starttimeStr = random200List(LIST_ROOM_TIME_SLOT) + day + x + "点" + i + "分" + roomName;
                    timeEntityMap.put(starttimeStr,
                            TimeEntity.builder().roomName(roomName).timeTemplate(String.format(TIME_TEMPLATE_Three, dayMap.get(day), x, i)).build());
                }
            }
        }
        return randomMap(timeEntityMap);
    }


    //几月几日 | 几月几号 | 1月13 | 23年1月5日 ； 几点
    public static Map<String, TimeEntity> T005() {
        Map<String, TimeEntity> timeEntityMap = new HashMap<>();
        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s日" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName)
                        .other(String.format(strTemplate, TimeDataConstant.CHINESE_100[month], TimeDataConstant.CHINESE_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }

        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s日" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName).other(String.format(strTemplate, TimeDataConstant.CHINESE_100[month], TimeDataConstant.NUMBER_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }

        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s日" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName).other(String.format(strTemplate, TimeDataConstant.NUMBER_100[month], TimeDataConstant.NUMBER_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }

        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s号" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName).other(String.format(strTemplate, TimeDataConstant.NUMBER_100[month], TimeDataConstant.CHINESE_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }
        return randomMap(timeEntityMap);
    }

    public static Map<String, TimeEntity> T006() {
        Map<String, TimeEntity> timeEntityMap = new HashMap<>();
        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s号" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName)
                        .other(String.format(strTemplate, TimeDataConstant.CHINESE_100[month], TimeDataConstant.CHINESE_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }

        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s号" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName).other(String.format(strTemplate, TimeDataConstant.CHINESE_100[month], TimeDataConstant.NUMBER_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }

        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s号" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName).other(String.format(strTemplate, TimeDataConstant.NUMBER_100[month], TimeDataConstant.NUMBER_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }

        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s号" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName).other(String.format(strTemplate, TimeDataConstant.NUMBER_100[month], TimeDataConstant.CHINESE_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }
        return randomMap(timeEntityMap);
    }

    public static Map<String, TimeEntity> T007() {
        Map<String, TimeEntity> timeEntityMap = new HashMap<>();
        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName)
                        .other(String.format(strTemplate, TimeDataConstant.CHINESE_100[month], TimeDataConstant.CHINESE_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }

        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName).other(String.format(strTemplate, TimeDataConstant.CHINESE_100[month], TimeDataConstant.NUMBER_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }

        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName).other(String.format(strTemplate, TimeDataConstant.NUMBER_100[month], TimeDataConstant.NUMBER_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }

        for (int month = 0; month < 12; month++) {
            for (int day = 0; day < 30; day++) {
                String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s月%s" + roomName;
                TimeEntity timeEntity = TimeEntity.builder().roomName(roomName).other(String.format(strTemplate, TimeDataConstant.NUMBER_100[month], TimeDataConstant.CHINESE_100[day]))
                        .timeTemplate("LocalDateTime.now().toLocalDate().withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                        .build();
                timeEntityMap.put(timeEntity.getOther(), timeEntity);
            }
        }
        return randomMap(timeEntityMap);
    }


    public static Map<String, TimeEntity> T008() {
        Map<String, TimeEntity> timeEntityMap = new HashMap<>();
        for (int year = 2023; year < 2030; year++) {
            for (int month = 0; month < 12; month++) {
                for (int day = 0; day < 30; day++) {
                    String roomName = random200List(LIST_ROOM_ROOM_SLOT);
                    String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s年%s月%s日" + roomName;
                    TimeEntity timeEntity = TimeEntity.builder().roomName(roomName)
                            .other(String.format(strTemplate, year, TimeDataConstant.NUMBER_100[month], TimeDataConstant.NUMBER_100[day]))
                            .timeTemplate("LocalDateTime.now().toLocalDate().withYear(" + year + ").withMonth(" + TimeDataConstant.NUMBER_100[month] + ").withDayOfMonth(" + TimeDataConstant.NUMBER_100[day] + ").atTime(0,0);")
                            .build();
                    timeEntityMap.put(timeEntity.getOther(), timeEntity);
                }
            }
        }
        return randomMap(timeEntityMap);
    }


    public static Map<String, TimeEntity> T009() {
        Map<String, TimeEntity> timeEntityMap = new HashMap<>();
        for (int hour = 0; hour < 24; hour++) {
            String roomName = random200List(LIST_ROOM_ROOM_SLOT);
            String strTemplate = random200List(LIST_ROOM_TIME_SLOT) + "%s点" + roomName;
            TimeEntity timeEntity = TimeEntity.builder().roomName(roomName)
                    .other(String.format(strTemplate, TimeDataConstant.NUMBER_100[hour]))
                    .timeTemplate("LocalDateTime.now().toLocalDate().atTime(" + TimeDataConstant.NUMBER_100[hour] + ",0);")
                    .build();
            timeEntityMap.put(timeEntity.getOther(), timeEntity);
        }

        return randomMap(timeEntityMap);
    }

    public static Map<String, TimeEntity> randomMap(Map<String, TimeEntity> timeEntityMap) {
        List<String> keys = new ArrayList<>(timeEntityMap.keySet());
        if (keys.size() > 30) {
            Map<String, TimeEntity> newMap = new HashMap<>();
            for (int i = 0; i < 30; i++) {
                String key = keys.get(RandomUtil.randomInt(0, keys.size()));
                newMap.put(key, timeEntityMap.get(key));
            }
            return newMap;
        }
        return timeEntityMap;
    }


    /**
     * 随机在集合中抽取元素
     *
     * @param allList
     * @return
     */
    public static String random200List(List<String> allList) {
        return allList.get(RandomUtil.randomInt(0, allList.size()));
    }

}
